Probabilistic model for file-specific compression selection under sla-constraints

ABSTRACT

One example method includes file specific compression selection. Compression metrics are generated for a chunk of a file using a reference compressor. Compression metrics for other compressors are determined from the metrics of the reference compressor. A compressor is then selected to compress the file.

FIELD OF THE INVENTION

Embodiments of the present invention generally relate to data processing operations. More particularly, at least some embodiments of the invention relate to systems, hardware, software, computer-readable media, and methods for data compression operations.

BACKGROUND

Data management is related to a variety of different operations. Backup operations, archive operations, and deduplication operations are examples of data management or processing operations. Another aspect of data management relates to data compression, including lossless data compression. Backup operations, archive operations, and data transmission operations, for example, benefit from compression.

By compressing data, storage and bandwidth usage is improved. More data can be stored in less storage space and more data can be transmitted using less bandwidth when data is compressed.

Data compression operations, however, also consume processing and other computing resources and there is often a need to balance service level agreement (SLA) requirements with compression levels. Stated differently, compression engines, including lossless compression engines, may be subject to SLA constraints.

Conventionally, compression operations are performed using predetermined algorithms. However, this may not be ideal at least because the best compression algorithm for one object may not be the best compression algorithm for a different object, even when the objects are of the same type.

BRIEF DESCRIPTION OF THE DRAWINGS

In order to describe the manner in which at least some of the advantages and features of the invention may be obtained, a more particular description of embodiments of the invention will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings. Understanding that these drawings depict only typical embodiments of the invention and are not therefore to be considered to be limiting of its scope, embodiments of the invention will be described and explained with additional specificity and detail through the use of the accompanying drawings, in which:

FIG. 1 discloses aspects of a data protection engine that includes a compression engine configured to select a compressor for a file;

FIG. 2A discloses aspects of a system configured to select a compressor for a file based on smaller portions of the file;

FIG. 2B discloses aspects of compression operations based on a single reference compressor;

FIG. 3 discloses aspects of a chunk extractor that may be included in a compressor engine;

FIG. 4 discloses aspects of extracting a chunk from a file;

FIG. 5 discloses aspects of training data used for a model that infers compression metrics;

FIG. 6A discloses aspects of training data;

FIG. 6B discloses aspects of differences between chunk ratios and complete file ratios;

FIG. 6C discloses aspects of a histogram of correction factors;

FIG. 6D discloses aspects of learned distributions of chunk compression ratios and correction factors of compression ratios;

FIG. 7A discloses aspects of a method for selecting a compressor for a compression operation;

FIG. 7B discloses aspects of determining a correction factor;

FIG. 7C discloses aspects of a joint distribution;

FIG. 7D discloses aspects of estimating the correction factor to be applied on a compression metric;

FIG. 8A illustrates examples of files and associated chunks of different sizes;

FIG. 8B discloses aspects of distributions of chunk compression ratios;

FIG. 8C discloses aspects of distributions of chunk compression ratios;

FIG. 8D discloses aspects of chunk compression relative ratios and distributions of chunk compression ratios;

FIG. 8E discloses aspects of chunk compression correction factors;

FIG. 9A discloses aspects of differences between true compression ratios and corrected ratios;

FIG. 9B discloses aspects mean squared errors of chunk ratios and corrected ratios;

FIG. 9C discloses aspects of corrected ratios, chunk ratios, and true ratios;

FIG. 9D discloses aspects of compressor rankings comparing true ratios with corrected ratios;

FIG. 9E discloses aspects of improvements in estimated compressor rankings;

FIG. 10 discloses aspects of an estimator configured to generate compression metrics based on a single reference compressor;

FIG. 11 discloses aspects of linear relationships observed between compression ratios;

FIG. 12A discloses aspects of generating compression metrics;

FIG. 12B discloses aspects of generating compression metrics based on a single reference compressor;

FIG. 12C discloses aspects of locating compression metrics computed for a reference compressor onto the joint distribution of the compression metrics learned for the compressor and chunk size;

FIG. 12D discloses aspects of estimating compression metrics;

FIG. 13A discloses aspects of distributions of chunk compression ratios by chunk size, for each compressor relative to a reference compressor;

FIG. 13B discloses aspects of chunk compression ratios by chunk size;

FIG. 13C illustrates a quality of inference of a probabilistic model versus a linear model;

FIG. 13D discloses aspects of differences between true ratios and correction ratios;

FIG. 13E illustrates effects of corrected ratios when generating estimated compression metrics;

FIG. 13F discloses aspects of improvements in estimated rankings for compressors.

DETAILED DESCRIPTION OF SOME EXAMPLE EMBODIMENTS

Embodiments of the present invention generally relate to data protection and data management. More particularly, at least some embodiments of the invention relate to systems, hardware, software, computer-readable media, and methods for data management or protection operations such as backup operations, restore operations, archive operations, and data transmission operations.

More specifically, example embodiments of the invention relate to compression operations. Embodiments of the compression operations disclosed herein may be performed in isolation or in the context or a larger operation such as a backup operation or a data transmission operation. The compression operations may include or relate to machine learning models, compression algorithm selection, and data compression.

Lossless data compression is an integral aspect of data management. Compressing data in a lossless manner to less than its original size potentially enables, compared to the original uncompressed data, increased transmission speeds and reduced storage requirements. Embodiments of the invention further relate to compressors that are, in effect, aware of and that determine, prior to compression, the data type and of data patterns inside the data being compressed.

Embodiments of the invention achieve more efficient compression ratios by selecting better compression algorithms for a compression operation compared to simply applying a predetermined compression algorithm. More specifically, embodiments of the invention may select a compressor (e.g., a compression algorithm) based on characteristics of the data set, the intended application or context, and/or SLA constraints. Embodiments of the invention may select a compressor on a file-by-file basis while satisfying any relevant SLA constraints. This allows the selection of a compressor to account for the characteristics of the file being compressed. Thus, a compression operation performed on multiple files may use multiple compressors.

Embodiments of the invention consider the context of the compression operation. In data movement or transmission situations, a complex compression algorithm may be overkill for a simple image. More specifically, any improvement in the compression ratio may not compensate for the additional computation time, which ultimately adds to the overall data transmission time.

In another example where data is being archived, a complex (but slow) compression algorithm that achieves a high compression ratio may be the best option because of the reduction in storage requirements. Thus, embodiments of the invention, when selecting a compressor, may consider the context in addition to the compression ratio achieved by the compressor.

Generally, the effectiveness of a compressor often depends on or is related to the characteristics of the data set. Although there are generic compressors, better compression may be achieved using compressors that are tailored for specific data domains, types, or patterns. However, the fact that a compressor is tailored for a specific domain, type, or pattern does not mean that the domain or type specific features of the files are available and can be readily used. In fact, inspecting the features and preparing the engineering tasks to compose these features are complex and can impose a computation cost on the compression operation.

Embodiments of the invention, in contrast, allow content-aware compression optimization without the need for feature engineering. For example, a compressor may be selected based on file type, which may be determined based on the average performance of a compressor on a large training set of files.

Embodiments of the invention further expand on content awareness to account for data pattern variations that may occur within files of different types and of the same types. Advantageously, embodiments of the invention may select a compressor on a file-by-file basis.

Embodiments of the invention are further timely and do not substantially add to the time required to perform the compression operation or other operations. For example, selecting a compressor using averages may be efficient while capturing data patterns and estimating compression performance can be more costly in different ways. In contrast, selecting a compressor on a file-by-file basis, in accordance with embodiments of the invention, is more efficient that simply running all available compressors on a file to measure each compressor's performance and then selecting the best compressor.

Generally, embodiments of the invention evaluate the compression metrics on a portion or a chunk of the file being compressed. Using training data, this allows the compression metrics associated with compressing the chunk to estimate the compression metrics on the whole file. In other words, the training data allows a correction factor to be determined that can be applied to the compression metrics associated with the chunk. This results in estimated file compression metrics. The estimated file compression metrics are then used to select a compressor to compress the whole file. The computational cost is thus reduced because the best compressor can be selected based on the compression metrics of a small chunk of the file.

As discussed herein, a compressor may be selected by generating compression characteristics using a small portion or a chunk of a file or object being compressed. By having each compressor in a set of compressors compress the sample, the best compressor can be selected based on the compression metrics and/or correction factors.

Embodiments of the invention further relate to estimating the compression metrics for all compressors in the set of compressors (or set of relevant compressors) based on a single reference compressor. This advantageously further optimizes the performance by a factor O(k), where k is the number of compressors in the set.

In addition, larger sample sizes can be used when estimating the compression metrics based on the compression metrics or performance of a single reference compressor. Selecting a compressor based on the compression metrics of a larger sample can reduce uncertainty and allows embodiments of the invention to have additional accuracy for more types of files. Even if using a single reference compressor introduces an additional estimation step, this has a minor effect on the results and does not impose any practical restrictions on the compression operations. Further, the speed of selecting a compressor for an input file or object is improved.

FIG. 1 discloses aspects of a data protection system that may perform data protection operations including compression and compression related operations. Embodiments of the invention, however, are not limited to data protection operations and can be implemented in any environment or system in which compression and compression related operations are performed. FIG. 1 illustrates a data protection system 102 that includes a compression engine 104. The data 108 is an example of backup data and may be, for example, a copy of production data generated at a production system. For example, data in a production system may be replicated, backed up, or otherwise protected by the data protection system 102. The data protection system 102 may be a physical appliance, a virtual appliance, a cluster, local and/or cloud-based.

The compression engine 104 may select a specific compressor for the data 108 based on various factors 106. Because the data 108 may contain distinct files, objects, or the like, the compression engine 104 may select a compressor on a file-by-file basis, an object-by-object basis, or the like. Examples of the factors may include, but are not limited to, one or more of: file type, context, application, SLA constraints, or combination thereof or the like. The compressed data 108 may be stored in a backup storage 110, which may be local to the data protection system 102, remote from the data protection system 102, cloud-based, or the like or combination thereof.

The following discussion refers to the data 108 as files, but embodiments of the invention are not limited to files. Thus, embodiments of the invention may be performed on chunks, objects, blocks, or the like.

The compression engine 104 may estimate compression metrics for a file based on a portion or a chunk of the file. Generating compression metrics for a chunk can be performed more efficiently than generating compression metrics for the whole file, at least because less data is being processed. The chunk is typically configured to be a representation of the whole file and is, in effect, a smaller file. In other words, the chunk is extracted such that it conforms to the file format. This allows the compression engine 104 to select a compressor in a timely manner based on compressing a smaller “file”.

FIG. 2A discloses aspects of a compression engine and discloses aspects of selecting a compressor and/or compressing the file. As previously stated, the process of selecting a compressor may be performed on a file-by-file basis. However, embodiments of the invention may also adapt by selecting a compressor for a group of files based on the compression metrics of a single file or chunk thereof.

FIG. 2A illustrates an example of a compression engine 200 that is configured to select a compressor for an input file. The compression engine 200 includes a chunk extractor 204 that is configured to extract a chunk from the file 202 for analysis. The size of the chunk may be determined by a chunk size 206, which may be variable, set by a user, based on file type, or the like or combination thereof.

The compression engine 200 includes an estimator 208 that is configured to generate compression metrics or compression performance metrics using the chunk extracted by the chunk extractor 204. The estimator 208 may generate compression metrics for multiple compressors 210 (represented by compressors 212 and 214).

Using smaller chunks to generate compression metrics rather than the whole file allows the estimator 208 to be orders of magnitude faster. In other words, generating compression metrics from chunks of files rather than whole files is less expensive computationally. The estimator 208 may generate compression metrics for each of multiple compressors by compressing the chunk with each of the available or valid compressors 210.

The optimizer 216 may consider an SLA 218 (and/or other factors) when selecting a compressor 220 to compress the input file 202. Thus, the selected compressor 220, which is one of the compressors 210, is selected based on compression metrics of a chunk, estimated file metrics, SLA constraints, and/or other factors such as application or context, or the like or combination thereof. A correction factor may also influence which of the compressors 210 is selected to compress the file 202.

FIG. 2B discloses aspects of compression operations based on the performance or compression metrics of a single reference compressor. The compression engine 230 is similar to the compression engine 200, but is configured to select a compressor from the compressor set 234 based on a single reference compressor 236. In other words, the compression engine 200 applies multiple compressors to the extracted chunk while the compression engine 230 only applies a single reference compressor 210 to the extracted chunk. Thus, the estimator 232 is configured differently from the estimator 208. Other aspects of the compression engine 230, such as the chunk extractor 204 and the optimizer 216, may be similar to the compression engine 200 or may be adapted as necessary.

The compression engine 230 in FIG. 2B has been configured to determine compression metrics by only considering one reference compressor 236 and/or data patterns found in chunks of the file to be compressed.

In one example, the estimator 232 may use a two-step estimation process to obtain the performance or compression metrics of all compressors in the compressor set 234. The first step estimates the compression metrics of all compressors in the compressor set 234 from the execution of a single reference compressor 236 on a chunk of the file 202 to be compressed. Even though the compression engine 230 may add an additional estimation step, the compression engine 230 may be faster than the compression engine 200 and may be able to select a compressor based on a larger chunk size, which further increases the accuracy. These estimates are provided to the optimizer 216, which selects the selected compressor 220 for the file to satisfy the SLA 218 and/or other requirements.

The compression performed by the compression engine 230 tends to be O(k) times faster than the compression engine 200 for a given chunk size, where k is the number of compressors in a set. From a performance perspective, the compression engine 230 may be operated using larger chunk sizes because only the reference compressor is used to compress the chunk in the compression engine 230 while the compression engine 200 compresses the chunk with each compressor. Using a larger chunk size reduces uncertainty regarding the estimation of the compression metrics. Further, an ultra-fast compressor may be chosen as the reference compressor, which allows embodiments of the invention to estimate compression metrics on the whole file rather than on chunks. The selected chunk size, however, may be application dependent.

In another embodiment, embodiments of the invention may perform compression using more than one reference compressors, but less than all of the compressors. Each of the reference compressors may be a fast representative of a family of similar compressors. This allows a model to be built for each family or clusters of families. This may increase the estimation accuracy, at the cost of running more compressors on each chunk of the input file.

FIG. 3 discloses aspects of the chunk extractor. FIG. 3 illustrates an example of a chunk extractor 304 that is configured to extract a chunk 312 from the file 302. Each time a file is processed by a compressor engine, at least one chunk 312 is extracted from the input file. Embodiments of the invention may also scale (e.g., multiple extractors, multiple estimators, etc.) such that multiple files may be processed simultaneously and individually.

More specifically, the ability of the estimator to generate relevant compression metrics can depend on the ability of the chunk extractor 304 to extract relevant data from the file 302. Ideally, the chunk 312 contains data patterns that influence the compression metrics. In this example, the chunk extractor 304 may include a type filter 306. This example of the chunk extractor 304 is related to and based on file type. The type filter 306 may determine the file type and direct the file to the appropriate extractor module.

After the file type of the file 302 is determined by the type filter 306, the type filter 306 may identify a specific extractor module that is configured to extract a chunk from the identified file type of the file 302. In this example, the chunk extractor 304 includes n extractor modules, represented by modules 308 through 310. In this example, the ability to identify the file type allows a specific extractor that may be specifically configured for the identified file type to be used to extract the chunk 312 from the file 302.

Thus, the extractor module 308 may be used to extract chunks from a first file type (e.g., an audio file of type flac). The extractor module 310 may be used to extract chunks from another file type (e.g., an image file of type jpeg). The extractor modules 308 through 310 may each be configured to account for a different file type when a chunk is being extracted. In effect, the chunk extractor 304 implements a chunking strategy that is based on file type in this example.

The modules 308, 310 each understand a file format or type that allows the file to be parsed such that relevant information is extracted. For example, if the file 302 is a bitmap file, the chunk 312 extracted from the file 302 may be a bitmap chunk that can be treated as a bitmap file. The chunk 312 is extracted such that the chunk 312 has a valid header, color table, or the like according to the file type. Thus, the chunk 312 respects the format of the file 302, including associated metadata.

The modules 308, 310 should also respect data alignment. For example, an RGB (Red, Green, Blue) image file includes data that represent pixels. As a result, a chunk from an RGB image file should be aligned to RGB pixel boundaries. The chunk should not break RGB triplets as this could impact the patterns exploited by the compressor.

FIGS. 4 through 9E discuss aspects of selecting a compressor for compressing a file based on compression metrics obtained by compressing the chunk with each compressor in a set of relevant compressors. FIGS. 10-13F discuss aspects of selecting a compressor for compressing a file compressing the chunk of an input file based on the compression metrics of a single reference compressor. Further, aspects of the disclosure set forth herein regarding FIGS. 4-9E are applicable to the embodiments disclosed in FIGS. 10-13F. For example, the chunk extractor 204, the optimizer 216 are similar and operate in a similar manner across embodiments of the invention.

FIG. 4 illustrates an example of extracting a chunk from a file. FIG. 4 illustrates a file 402 a from which a chunk 410 is being extracted. The file 402 a is input into the extractor 404. The extractor 404 may identify the type of the file 402 a and select a particular module to extract the chunk 410. The extractor 404 may also generate or extract a chunk whose size is determined by the chunk size 406, which may be an input to the extractor 404.

In one example, predefined locations 408 may be identified in the file 402 b (which represents the file 402 a as the chunk is being extracted). Thus, data is collected by the relevant extractor module from the locations 408 until the chunk size 406 is reached. The chunk 410 thus includes portions of the file 402 b from one or more of the locations 408. However, the chunk 410 could be extracted from a single location in the file 402 b. More generally, the location or locations from which the chunk 410 is extracted may be contiguous or non-contiguous with respect to the file 402 b. This may be dependent on the file type and the configuration of the respective module. As previously stated, the chunk 410 is, in effect, a small file whose type is the same as the input file.

Once the chunk 410 is generated, when using the compression engine 230, the chunk may be compressed by each of the available compressors and compression metrics are generated for each compressor. When using the compression engine 230, compression metrics are only generated for a reference compressor. The compression metrics can be used, at least partially and in these embodiments, to select the compressor used to compress the whole file 402 a.

Embodiments of the invention further establish a relationship between the compression metrics associated with a chunk to the compression metrics associated with the file as a whole. It is expected that the compression metrics for a chunk will be different from the compression metrics associated with the file as a whole. Embodiments of the invention relate to an estimator configured to generate estimated compression metrics that are representative of how the whole file will be compressed based on the chunk compression metrics. As described in more detail below, the compression metrics for a chunk are effectively corrected. The estimated file compression metrics, which are chunk compression metrics that are corrected using a correction factor, are an estimate of what would be achieved if the whole file were compressed.

In order to generate compression metrics, embodiments of the invention generate a model or set of models by running all available compressors on a set of training files. The set of training files may include files of different types. The set of training files also includes whole files and chunks of different sizes.

FIG. 5 discloses aspects of training a model and aspects of a set of training files. This example discusses processes associated with generating the training data. As a result, multiple chunks of each file are processed for training purposes. Once trained, only a single chunk is needed from a new file to select the best compressor.

In FIG. 5 , the set of training files is represented by files 502 through 504. Each file may be processed, for example, by an appropriate extractor module, to extract chunks of different sizes. For each of N files in a set of training files, M chunks are extracted for each file. In this example, the file 502 may be associated with chunks 512 and the file 504 may be associated with chunks 514. Although the number of chunks is not limited and by way of example only, chunks may be generated in sizes from 1% to 100% in 1% increments. By way of example only and not limitation, the chunks range in size from 1 to 100 percent (a 100% chunk is the whole file). The files could have been chunked at other increments such as 5% increments.

When generating the model, all of the M chunks for each file are processed by all of the compressors 506. This allows compression metrics 508 to be generated for each of the chunks of each file in the set of training files. In one example, a compression ratio is an example of a compression metric. The compression ratio may be defined as the size of the original chunk to the size of the compressed chunk. Compression metrics may also include compression and decompression throughputs, which are computed as the size of the file or chunk divided by the time needed to compress or decompress the file or chunk. Processor usage and memory usage may also be included as compression metrics.

The compression metrics may include compression ratios between the uncompressed size and the compressed size. The training set includes N files, M chunks for each of N files, and O compressors. These are indexed ((a, j, k), where i indexes the file, j indexes the chunk, and k indexes the compressor). The compression ratios may be defined as:

${{File}{compression}{{ratio}--}{f_{ratio}\left( {i,k} \right)}} = \frac{{size}({file})}{{size}\left( {{compressed}{file}} \right)}$ ${{Chunk}{compression}{{ratio}--}{f_{ratio}\left( {i,j,k} \right)}} = \frac{{size}({chunk})}{{size}\left( {{compressed}{chunk}} \right)}$

After running the compressors 506 on the set of training files and their chunks, training data is obtained and includes the compression metrics.

FIG. 6A illustrates an example of training data obtained from the set of training files. The table 600 illustrates a sample of the training data. The same training data is used for both the compression engine 200 and the compression engine 230. The table 600 illustrates compression ratios for files that are compressed by multiple compressors. The table 600 also illustrates compression and decompression throughput. Similar data is obtained for each chunk of each file. For example, the first row for a 25% size chunk of a file results in a 2:1 compression ratio using the lossless JPEG compressor. The same file has a compression ratio of 1.3:1 when the 25% size chunk is compressed with the Gzip compressor.

To build a model or learn the relationships between the compression metrics obtained for the chunks and the compression metrics of the source files, these relationships are initially observed or determined from the training data. Embodiments of the invention further relate to observing relationships between the compression metrics of a reference compressor to the compression metrics of other compressors.

FIG. 6B illustrates differences between ratios obtained for chunks and ratios obtained for complete or whole files (100% chunk size). The graph 602 illustrates differences between the compression ratios for chunks of different sizes and the compression ratio of the full file. As illustrated in the graph 602, the differences become smaller as the relative sizes of the chunks increase. For example, the difference between the compression ratio of the whole file and the compression ratio of the 5% chunk is greater than the difference between the compression ratio of the whole file and the compression ratio of the 85% chunk. This is likely explained by the data patterns found in chunks relative to the data patterns found in the complete files. The graph 604 illustrates that the relationships between the chunk compression ratios and the full file compression ratios is not obvious. Generally, and by way of example, however, the graph 602 illustrates that the compression ratios determined from chunks tends to underestimate the compression ratio of the whole file regardless of which compressor is used.

Embodiments of the invention further relate to a method for correcting the chunk compression ratio obtained with a compressor c_(k) applied to chunk S_(j) of file f_(i) to find the compression metric on the file f_(i). Thus, embodiments of the invention may determine a correction factor for each chunk size.

The correction factor is defined as follows in one embodiment:

${r_{metric}\left( {i,j,k} \right)} = \frac{{metric}\left( S_{i,j,k} \right)}{{metric}\left( f_{i,k} \right)}$

Using the training data, the correction factor is a ratio between the compression metric of the chunk to the compression metric of the file. In one example, the correction factor is configured to adjust the compression metric of a chunk to match the compression metric of the whole file. As previously stated, the training data in the graph 602 illustrates that the compression ratio of the chunks underestimates the compression ratio of the whole file. Thus, the correction factor allows the measured compression metric of a chunk to be corrected to obtain an estimated file compression metric, which is likely closer to the true compression metric of the whole file.

FIG. 6C discloses aspects of a histogram of correction factors. The histogram 606 illustrates correction factors of compression ratios r_(ratio) for a compression algorithm c_(k) on all relative chunk sizes of a training set. As illustrated in the histogram 606, the correction factor tends to 1 as the chunk size approaches the whole file size.

This relationship is learned via a model derived from the training data. The model is expected to show, for each compressor and each relative chunk size, the relationship between the chunk compression metric and the file compression metric.

In one example, a mixture of Gaussian functions are fit on the training data of each chunk size, for each compressor. The model for each compressor will be a set of normal functions, where

_(,k)(μ^(T),Σ) represents the mixture of Gaussian functions for compressor c_(k) and relative chunk size j.

In one example, the parameters of each mixture of Gaussians may be application dependent. By way of example only, a Bayesian Gaussian Mixture model may be used:

Θ(c _(k))={

_(,k)(μ^(T),Σ)∀j∈[1, . . . , M]}

FIG. 6D discloses aspects of learned distributions of chunk compression ratios and correction factors of compression ratios. The distributions 608 are examples of learned distributions of chunk correction factors of compression ratios, r_(ratio), for a compression algorithm c_(k) on all chunks of a given size. In this example, the correction factors tend to 1 as the chunk size approaches 100% of the size of the source files. The learned distributions illustrated in FIG. 6D include distributions for chunk sizes of 10%, 40%, 70% and 100%.

FIG. 7A discloses aspects of compression operations. More specifically, after learning the joint probability density functions, a compression engine is now prepared to estimate compression metrics on a new file f_(new) using the compression metrics obtained from the compression of small chunks S_(new,j). The estimated compression metric for the new file will be generated by correcting the compression metrics obtained from a chunk of the new file with the correction factor.

In this example, a new file is received 702 at a compression engine that has been trained or prepared using the set of training files and the training data obtained therefrom. Receiving the file may include determining a file type such that a specific extractor module may be used based on the file type to extract a chunk therefrom. The extractor may include multiple modules that are each configured for a different file type.

Once the file type is determined, a chunk is extracted 704 from the new file using one of the modules. As an example, the size of the chunk extracted from the new file may be 5% of the size of the new file. As previously stated, smaller chunks have the advantage of increased efficiency at least from a computational perspective.

Next, the extracted chuck is compressed 706 with all available compressors. More specifically, the extracted chunk is compressed with all valid compressors for the file type. For example, an image file may be compressed with image-specific compressors such as FLIF Lossless JPEG, TIFFLzw, TIFFZip, and generic lossless compressors such as gzip, lzma, bzip, or the like. Compressors that are configured specifically for other file types may be omitted. Because the size of the chunk is small compared to the size of the new file, running all of the valid or relevant compressors takes a fraction of the time that would be required to run all of the valid compressors on the whole file.

After all of the valid compressors have been run on the extracted chunk, compression metrics are determined 708 for each compressor. The chunk compression ratio may be expressed as follows for the valid compressors:

${s_{ratio}\left( {{new},{5\%},k} \right)} = \frac{{size}\left( {{uncompressed}{chunk}} \right)}{{size}\left( {{compressed}{chunk}} \right)}$

Once the compression metrics have been determined for the chunk for each of the valid compressors, the correction factors may be determined 710. In one example, the correction factors are based on the joint probability distributions generated from the set of training files.

The correction factors are then used to determine or estimate 712 file metrics or file compression metrics. File metrics, which may identify the amount of compression expected for the new file, can be determined for each compressor based on the corresponding correction factors and the chunk compression metrics. By relying on the actual compressors, embodiments advantageously avoid any need for custom or type dependent feature engineering. Further, the chunks are valid files (e.g., the extracted chunks comply with the file format) for input to the compressors and the compression of the whole file can be estimated based solely on previous compressions of chunks of similar relative size.

Embodiments of the invention further model the distributions for multiple relative sizes. This gives flexibility to embodiments of the invention. For example, applications that require higher precision in the estimations may choose to extract larger chunks from the files. If larger chunks are extracted, there may be a performance impact because it takes longer to perform the compressions. As a result, embodiments of the invention allow users or application to select the appropriate or desired chunk size.

Once the file metrics are determined or estimated, optimization is performed 714 to select a compressor. The optimization may account for other factors such as context and SLA constraints in addition to the estimated file metrics. The optimization may select a compressor based on the estimated file metric, compression throughput, decompression throughput, application, and/or other constraints. In one example, a weighted performance function, P, for a compressor c_(k) over a set of compression metrics M may be defined as:

${P\left( {c_{k}{❘w}} \right)} = {{\sum\limits_{i \in M}{w_{i}*{{\hat{f}}_{i}\left( {{new},k} \right)}}} = \left\langle {w,{{\hat{f}}_{metric}\left( {{new},k} \right)}} \right\rangle}$

In one example, the efficiency function is a dot product between the estimated compression metrics for the new file f_(new) and weights w associated with the SLA constraints related to each compression metric of interest. In one example, the selected compressor is:

$C^{*} = {\underset{c_{k} \in C^{\prime}}{argmax}{{P\left( {C_{k}{❘{f_{new},w}}} \right)}.}}$

In a maximization function, C′ is a set of all valid compressors for file f_(new), which may be a subset of C.

FIG. 7B further illustrates an example of determining a correction factor (which may be a ratio or other value). Determining the correction factor is an example of determining or inferring the estimated file metrics for a new file based on the training data.

Initially, the compression metrics for the chunk are located 720 onto the joint distribution for each compressor for the relevant chunk size. FIG. 7C illustrates a joint distribution 730 and illustrates locating the compression metrics of a chunk onto a joint distribution, which is defined as, in one example:

_(5%,k)(μ^(T),Σ)

More specifically, FIG. 7C illustrates a metric s_(ratio)(new,5%,k) located onto the distribution of compression ratios and correction factors. In addition, a neighborhood is also located 722 around the metric s_(ratio)(new,5%,k), which is within an application defined tolerance in one example with limits [a,b]. The neighborhood is determined by these limits in one example.

Next, the expected value of the correction factor within the neighborhood around the metric s _(ratio)(new,5%,k) is determined. In one example, this is equivalent to computing an integral over intervals:

r_(metric)∈[−∞, +∞] and s_(metric) ∈[a,b]

An example of the integral is:

r ^ metric ( new , 5 ⁢ % , k ) = E ⁡ ( r metric ) ❘ "\[LeftBracketingBar]" a b = ∫ - ∞ + ∞ ∫ a b r metric 5 ⁢ % , k ( r metric , s metric ⁢ ❘ "\[LeftBracketingBar]" μ T , ∑ ) ⁢ drds

The interval [a,b] around s_(ratio)(new,5%,k) is used, in one example, because every compressor exploits some pattern of the input file. Thus, chunks with similar patters may result in similar compression metrics for a given compressor, which leads to similar correction factors. By computing the expected value of r_(metric) inside the interval, a content-aware approach that improves the quality of the estimated correction factors is achieved.

FIG. 7D illustrates an example of estimating the correction factor to be applied on a compression metric. The estimate corresponds to the expected value of the correction factor inside the neighborhood of s_(ratio)(new,5%,k).

Next, file metrics are estimated or determined 726. For each compressor, estimates of the compression metrics on the complete file f_(new) are determined by applying the estimated correction factor to the metrics obtained for the chunk. This is reflected as follows:

${{\hat{f}}_{metric}\left( {{new},k} \right)} = {\frac{s_{metric}\left( {{new},j,k} \right)}{{\hat{r}}_{metric}\left( {{new},j,k} \right)}.}$

The file metric {circumflex over (f)}_(metric)(new,k) can be used during optimization as previously discussed.

In some embodiments, all valid or relevant compressors are executed on the extracted chunks. For small chunks, the generation of the correction factors and estimation of the file metrics may be fast. However, the fitted probability distributions on relatively small chunk sizes may have more uncertainty or variance. Even though embodiments of the invention can correct any deviation from the compression metrics on the complete files, the balance between the speed of execution and estimation precision may be considered.

Embodiments of the invention thus select the best compression algorithm or compressor to be used on a file based on the contents of the file, the type of the file, and/or user or application specific SLA constraints. Embodiments of the invention can select the best compressor based on patterns found in files or chunks rather than strictly on file type.

The following examples illustrate embodiments of the invention and are discussed with respect to FIGS. 8A-9E. Color copies of FIGS. 8A-9E and 12B-13F are included in an appendix, which is incorporated by reference in its entirety.

In this example, a training set of files includes a set of image files and a set of audio files. From each of these files, chunks were extracted. The sizes of the chunks began at 5% and increased at increments of 5%. FIG. 8A illustrates an example of an image file and an audio file (files 802 are representative of all files in the set of training files) and illustrates selected chunks 804 from each of these files. FIG. 8A illustrates that the chunks were selected from a center point (e.g., a seed point) of the files. The chunks may be extracted by an extractor module included in the extractor.

A training set of data is generated by compressing all of the chunks 804 from all of the files 802. In one example, a set of lossless compressors are used to generate the compression metrics. Some compressors are parametrizable. As a result and by way of example, distinct configurations of a specific compression algorithm may constitute a distinct compressor for purposes of generating the training set of data and selecting the best compressor.

For example, the audio chunks 804 were compressed using the following compressors:

-   -   flac0—a Lossless Audio Codec;     -   gz1 and gz9—gzip compression, based on DEFLATE algorithm, in the         lowest and highest compression levels; and     -   lzma0 and lzmaExtreme—compressors implementing Lempel-Ziv-Markov         chain algorithm parametrized with presets for low memory usage         (fastest but lowest compression ratio) and for highest         compression ratio (slower, and with higher memory usage),         respectively.

In this example, only the flac0 compressor is a type-specific compressor. The gzip and lzma algorithms are generic compressors.

For image files, six representative compressors were used:

-   -   JPEG2000—an implementation of the JPEG2000 lossless compression;     -   TIFFLzw and TIFFZip—Tag Image File Format compression in LZW and         zip modes, respectively;     -   flif100—a Free Lossless Image Format compressor; and     -   lzma0 and lzmaExtreme—same as for the audio files, as described         above.

Assuming that there were 1713 image files and 1432 audio files in the training set of files, generating the training set of data required 171,300 audio chunk-compressions (1713 files×20 chunks×5 compressors) and 171,840 image chunk-compressions (1432 files×20 chunks×6 compressors). Compression metrics for these chunks were computed.

With the resulting training data, a model was built as previously described. This resulted, as illustrated in FIG. 8B, in distributions 806 of chunk compression ratios by chunk size for each compressor for the audio files in the training set of files.

As illustrated in FIG. 8B, the compression ratios obtained for the chunks using a type-specific compressor (flac0) varies according to the chunk size more drastically than when using generic compressors. In this example, although flac0 obtains the overall highest compression for the full file (100% chunk size), the flac0 performs poorly for small chunk sizes. In fact, some of the ratios are smaller than 1 (the compressed data is larger than the original data).

FIG. 8C illustrates distributions 808 of chunk compressions by chunk size, for each compressor, for image files in the training set. The distributions 808 illustrate that the compression ratios obtained for the smaller chunks of image files are much more similar to the compression ratios obtained for the full files, regardless of compressor. However, there is high variability in the compression ratios obtained from different compressors, which demonstrates that the relationship between chunk ratios and ratios on complete files is not obvious.

FIG. 8D illustrates the relative compression ratios 810 of the chunks over the full file compression ratio for audio files in the training set and compression ratios 812 of the chunks over the full file compression ratio for image files in the training set.

FIG. 8E illustrates the learned joint distributions 814 of chunk compression ratios and correction factors of compression ratios for each compression algorithm on all chunks (for chunk size of 5%) of audio files in the training set and the learned joint distributions 816 of chunk compression ratios and correction factors of compression ratios, for each compression algorithm on all chunks (chunk size of 5%) of image files in the training set.

Once the learned joint distributions are generated, this example proceeds to determine or estimate compression metrics for new files and to select the optimal compressor for the new files. In these example experiments, the new files include 500 files of each type (image and audio). These new or test files were selected from the same datasets from which the training set of files were selected. These test files were not used to train the probabilistic models.

In a practical application, a chunk of a pre-determined size (e.g., 5%) from a single new file would be extracted and the correction factor for each compressor would be estimated based on the distributions generated from the training data. For validation purposes, however, this process is performed exhaustively for the test files. Thus, each of the test files is chunked into all chunk sizes and each of these chunks is compressed with each compressor—similar to the training stage. In addition, the whole test files (100% chunk size) are compressed to determine the actual or true compression metrics for the files.

After applying the correction factor to the chunk compression ratios, it is possible to compare the estimated file compression metrics or ratios generated by embodiments of the invention to the actual file compression metrics of the whole file. Some results for the test set—for chunks of 5%, 45% and 90%—are shown in FIG. 9A, which compares, for each chunk (x-axis), the obtained corrected ratio to the true ratio (y-axis). FIG. 9A illustrates that for larger chunks (e.g., 90% chunks, bottom graphs) the estimated ratio is, expectedly, much closer to the true compression ratio. For smaller chunks (e.g., 5% chunks, top graphs) the corrected ratios may differ from the true ratio. A difference of zero indicates that the method yields the exact compression ratio of the full file. In FIG. 9A, the corrected chunk ratio is in orange and the original chunk ratio is in blue (see Appendix).

FIG. 9B illustrates additional evidence to that provided in FIG. 9A. FIG. 9B illustrates a comparison 904 of how the compression ratios obtained for the chunk and the corrected compression ratios obtained with embodiments of the invention compare with the true compression ratios. In FIG. 9A, the mean squared errors between chunk ratios (corrected chunk ratios 906; original chunk ratios 908) and the true compression ratios. The means squared error obtained with embodiments of the invention is smaller than that obtained with the compression chunks without correction. In addition, the effectiveness of applying the correction factors should be particularly noticeable on smaller chunks. As shown in FIG. 9B, the positive effects of the correction factors (i.e., the reduction in the mean squared error) is noticeable across all chunk sizes, and even more noticeable across the smaller chunks. In FIG. 9B, the mean squared errors of the chunk ratios are in blue and corrected chunk ratios are in orange.

FIG. 9C illustrates scatter plots to illustrate improvements in embodiments of the invention. The differences between the performance of the method on audio files (910) and image files (912), and on small (5%) and large chunks (80%) are highlighted in FIG. 9C. The solid line in FIG. 9C represent the true compression ratio to approximate on the test set, and the dots represent the approximations obtained with embodiments of the invention (orange) and by simply compressing the chunk, without correction (blue). The corrections are closer to the true compression ratio than the uncorrected compression metrics.

Overall, the compression ratios obtained with embodiments of the invention (orange cloud of points) are closer to the solid line on both small and large chunks. As shown in the figure for 5% chunks, there were a few cases in which the correction factor deteriorated the result initially obtained via the compression of the chunk. In most cases, however, the positive effect of applying the correction factor was significant. Despite the less noticeable differences on 90% chunks, the orange cloud of points is also closer to the solid than the blue one.

The scatter plot 910 illustrates corrected ratios (in orange) and chunk ratios (in blue) versus the true ratio (in black) for 5% audio chunks and 90% chunks of audio files. An example of a correction improving the estimation and of a (rare) correction deteriorating the ratio are highlighted.

FIG. 9C also illustrates a scatter plot 912 to show the results for image files. Although the correction factor seems to significantly reduce the error for image files as well, the effects are not as pronounced as the ones for audio files. This is in line with the observation that the compression ratios obtained for the smaller chunks of image files are typically similar to the compression ratios obtained for the full files. That is, there is less space for improvement for certain types of files. In FIG. 9C, the orange dots correspond to corrected ratios and the blue dots to chunk ratios. The true ratios are in black in FIG. 9C.

By way of example, only, these results show that embodiments of the invention obtain an estimated file compression metric that is much closer estimate to the true compression ratio than taking the chunk ratio without correction. In particular, embodiments of the invention allow for a close estimate (e.g., within 0.05 mean squared error) to be obtained with much smaller chunks. For audio files, this level of error is obtained with chunks larger than 35% when considering the chunk ratio, and with chunks as small as 5% when considering the corrected ratio output by the methods disclosed herein. For image files, this level of error is achieved by chunks larger than 45% considering the chunk ratio, and with chunks of 30% according to embodiments of the invention.

However, embodiments of the invention, in addition to predicting compression ratios of full files, are directed to selecting the best compressor for a given input file. In one example, an additional assessment is performed that does not necessarily relate to the error in the estimated compression metrics. This relates to ranking the compressors and determining how estimating the compression ratio improves the rankings of the available compressors.

FIG. 9D illustrates and example of inferring to select compressor for a 5% chunk size of an image file. FIG. 9D also illustrates the resulting rankings and the scoring of the rankings with respect to the true rankings, which true rankings are based on true compression metrics. This illustrates that the chunk ratio and the estimated or corrected ratio obtained by embodiments of the invention may imply alternative compressor rankings. These may differ from the true ranking (ranking the compressors by the true ratio, given by compressing the whole original file).

To evaluate the effects of the correction factor in selecting the best compressor, a score of the resulting rankings is determined. The score is computed as a fraction of the partial orderings in the true ranking that are respected by the estimated ranking. In the example of FIG. 9D, the estimated ranking only changes one such order (B<C, meaning that, in the true ranking compressor B was placed higher than compressor C) out of the 10 orders. All other 9 orders are respected. The ranking based on chunk compression ratios, on the other hand, changes 3 orders (B<C, B<E and D<E) and thus only respects 7 out of the 10 orders.

For example, section 920 illustrates that 5 compressors A, B, C, D, and E were used to compress a file. Section 920 illustrates the true compression ratio, the chunk (5% chunk) compression ratio and the inference to generate the estimated compression ratio. The section 922 illustrates a true ranking, a chunk ranking, and an estimated ranking as previously discussed. The section 924 further illustrates the scorings of the chunk and estimated file rankings with respect to the true rankings.

Notice that one such ranking (and corresponding score) is computed for each of the 500 test files of each type. In FIG. 9E, we see the changes in the histogram of the score of the estimated rankings versus the chunk rankings over the entire test sets.

FIG. 9E illustrates histograms 926 of scores of the estimated rankings (corresponding to the estimated ratio) and the chunk rankings (corresponding to the chunk ratios) for the 5% chunks of the audio (left) and image (right) test sets. In FIG. 9E, the estimated ratio is in orange and the chunk rankings corresponding to the chunk ratios are in blue.

The results show that embodiments of the invention improve the results. For the audio test set, the scores of the chunk rankings are predominantly in the range between 0.5 and 0.6, while the estimated ranking—resulting from embodiments of the invention—achieves an identical ranking to the true ranking in over 400 out of the 500 cases. For the image set, a significant portion of the chunk rankings are already identical to the true ranking (around 150 cases), with an even larger portion with a score of in the range of 0.80 to 0.95. Still, the method performs positively, marginally improving some rankings (particularly the chunk rankings with lower scores in the 0.05-0.10 range, 0.20-0.25 range, 0.50-0.55 range and 0.65-0.70 range), but mostly by improving the rankings in the range of 0.80-0.90 range to the 0.90-1.00 range.

As previously suggested, embodiments of the invention may be used in various ways. For example, embodiments of the invention may be implemented in enterprises that apply federation and abstraction over multiple heterogeneous clouds (e.g., Amazon, Azure, private) and applying policy to dictate where operations are executed and data resides. Embodiments of the invention are useful for object storage (in the context of storing objects, transmitting objects, etc.). More specifically, embodiments of the invention are useful object storage in that, with awareness of the content and a history of how specific compressors will perform, the object storage system can make informed decisions on which compression to use to satisfy the desired policy for a given storage pool. For example, an administrator could specify:

I want to maximize the reduction in capacity consumed on Azure

I want to minimize the transfer time while writing to Dell ECS

I want to balance decompression time with transfer time while interacting with Amazon S3.

For a service that applies federation and abstraction over multiple heterogeneous clouds, the service can provide information about which compressor to use. This may be based on various metadata, such as object filename, content type, content length, bucket or destination, physical repository, and SLA parameters in the form of weights for compression ratio, compression throughput, and decompression throughput. This allows a user to employ controls according to their needs around capacity reduction, decompression time, or maximizing throughput.

FIG. 10 discloses aspects of an estimator configured to estimate the performance of all candidate compressors for a given file based on the compression metrics of a single (or subset) of reference compressors. The estimator 1000 provides the compression estimates to an optimizer, which selects the best compressor for the file based on the estimated compression metrics and/or other factors. FIG. 10 illustrates an estimator 1000, which is an example of the estimator 230 in FIG. 2B.

More specifically, the estimator 1000 compresses a chunk 1002 of a file to be compressed using a single reference compressor 1004, which is selected from a group of candidate compressors 1006.

In order to generate estimates of compression metrics for each of the compressors in the candidate compressors 1006, the estimator 1000 learns or was trained using the relations between the compression metrics of the reference compressor 1004 and the compression metrics of the n-1 compressors remaining the candidate compressors 1006. observed in training data. These relationships may also consider the characteristics of the data in the chunk 1002 or corresponding file.

Embodiments of the invention thus relate to a model that allows estimates of compression metrics of multiple compressors to be obtained based on the compression metrics of a single reference compressor 1004. The chunk 1002 can vary in size. Using smaller chunk sizes, the efficiency gains may be inversely proportional to the chunk size used by the model and proportional to the number of candidate compressors 1006.

The estimator 1000 may use or be trained with the training data represented by the table 600 shown in FIG. 6A. Using the table 600, relationships between the compression metrics obtained for chunks compressed by the reference compressor and the compression metrics obtained for all other compressors on the same chunks can be evaluated to prepare the models.

The training data shown in the table 600, which is a subset of all the training data, is obtained by running the compressors on all of the training files and their chunks as previously described. The training data includes, for example, a relative size of a chunk (to the size of the file), the compressor used in each instance, and compression metrics. Thus, the training data includes compression metrics for multiple chunk sizes including where the chunk is the whole file (100% chunk size).

The training data allows a model to be built to learn the relationships between the compression metrics obtained with the compressors. In one example, these relationships were analyzed across the entire training data set. This analysis demonstrated that the ratios obtained with all of the compressors are correlated with the ratios obtained for the reference compressor. The correlation may be linear.

FIG. 11 illustrates this behavior and illustrates the compression ratios obtained with some lossless image compressors algorithms relative to a reference compressor (gz1 in this example). FIG. 11 illustrates, for example, linear relationships 1100 between compression ratios with a compressor and the reference compressor. The overall correlation between the compressors and the reference compressors in this training data of files (e.g., image files) was p≈0.78. A similar relationship was determined for other data types.

The linear relationship between the compressors and the reference compressor is in part related to the fact that compressible patterns tend to be exploited in similar manners. Differences may arise relating to how these patterns are actually exploited. For example, generic compressors such as gzip and Izma exploit the patterns as the patterns are presented in the raw byte stream. Image compressors may look more deeply into the data structure and investigate (for images) color channels, frequency amplitudes, etc., that may not appear in the raw byte stream.

Thus, as illustrated in FIG. 11 , the correlation between the generic compressors and the reference compressor may be higher than the correlation between type specific compressors (TIFF and FLIF in FIG. 11 ) and the reference compressor.

In one example, the linear relationship may not capture all the variability of the data. The actual relationship may also depend on the chunk size, which in turn relates to the patterns found in the data. However, experimenting with file chunks provides knowledge that allows a more precise model to be built to capture the relationships between compressors. In one example, embodiments of the invention model the per-compressor, per-chunk size relationships with a probabilistic approach.

In one example, a mixture of Gaussian functions are fit on the training data for each chunk size, for each compressor. The model for each compressor is a set of normal functions, where

_(,k)(μ^(T),Σ) represents the mixture of Gaussian functions representing the probabilistic relationship between a compressor c_(k) and reference compressor c_(Ref) for a given chunk size j:

Θ(c _(k) , c _(Ref) j)={

_(j,k)(μ^(T),Σ)∀j∈[1, . . . , M]}

The parameters of each mixture of Gaussians may be application dependent.

After learning the joint probability density functions, compression metrics on a new file f_(new) can be estimated from the metrics obtained with c_(Ref) applied to small chunks S_(new,j).

FIG. 12A discloses aspects of an inference process that may be performed by a compression engine. Initially, a chunk of a predefined relative size j is extracted from a new file 1210. The chunk size may be small (e.g., 5%) at least because smaller chunk sizes increase the efficiency and performance. The compressor selected as the reference compressor may be the fastest compressor as determined from the training data. The reference compressor, however, may be selected in a different manner. In one example, the gzip compressor in its fastest configuration may be selected for all file types because it is the fasted based on the training data. Different training data may result in the selection of a different compressor. However, any compressor can be used as the reference compressor.

Next, the chunk is compressed 1212 with the reference compressor 1214. This results in a compressed chunk 1216 that is associated with compression metrics 1218 (s_((new, 5%, Ref)) in this example chunk size). The compression metrics 1218 are entered as input to a probabilistic model—the compressor models 1220. A model is provided for each relevant compressor. Because the type of the new file 1210 is known, the compressors associated with that file type are also known and form a set of compressors used for that file type.

The compression metrics 1218 are input to the compressor models 1220 to generate estimated compression metrics 1222. More specifically, the model for compressor C1 may generate estimated C1 compression metrics. Similarly, the modes for compressors C2, C3, Cn may generate estimated C2, C3, and Cn compression metrics 1222.

Thus, the compression metrics for each compressor in a set of compressors are determined or estimated from the estimated compression metrics of a reference compressor. The compression metrics 1222 represent the estimated chunk compression metrics. The whole file compression metrics may be estimated in a subsequent step described below. Further, a correction factor may be determined and applied as previously described.

FIG. 12B discloses aspects of estimating or inferring compression metrics for compressors in a set of compressors using a single reference compressor and associated reference compression metrics. Initially, a chunk is extracted 1230 from a new file. The chunk, which may have a predetermined or a selected size, is then compressed 1232 with a reference compressor to generate compression metrics.

Using these compression metrics, the estimated compression metrics of all compressors in the set are generated 1234. Generating the estimated compression metrics for each compressor may include several elements.

First, the compression metrics for the reference compressor for the chunk are located onto a joint distribution. As illustrated in FIG. 12C, given j=5%, the metric s_(ratio)(new,5%,Ref) is located on the joint distribution 1236 of compression ratios where c_(k) (one of the compressors in the set)=JPEG2000 and the reference compressor c_(Ref)=gz1.

Next, a neighborhood around s_(ratio)(new,5%,Ref) that is within an application defined tolerance with limits [a,b] is located. The parameters a and b are illustrated in FIG. 12C. Finally, the expected value of the compression metric for c_(k) within the neighborhood around s_(ratio)(new,5%,Ref) is computed around s_(ratio)(new,j,Ref). For simplicity s_(ratio)(new,5%,Ref) is defined as s_(j,k) and s_(ratio)(new,j,Ref) is defined as s_(j,Ref). This is equivalent to computing an integral (shown below) over intervals s_(j,k)∈[−∞, +∞] and s_(j,Ref)∈[a,b]. The integral is:

e ^ metric ( new , j , k ) = E ⁡ ( s j , k ) ❘ "\[LeftBracketingBar]" a b = ∫ - ∞ + ∞ ∫ a b s j , k j , k ( s j , Ref , s j , k ⁢ ❘ "\[LeftBracketingBar]" μ T , ∑ ) ⁢ ds j , Ref ⁢ ds j , k

The expected value is illustrated in FIG. 12D, wherein j=5%. FIG. 12D illustrates the estimated metrics for a compressor c_(k) after compressing a chunk of 5% with compressor c_(Ref). The estimate corresponds to the expected value of the metric for c_(k). Considering the interval [a,b] around the s_(ratio)(new,j,Ref) allows embodiments of the invention to account for the fact that every compressor exploits some pattern of the input file. By assuming that chunks with similar patterns will be exploited in a similar way by different compressors, this leads to better predictability of the compression metrics. By computing the expected value of s_(j,k) inside the interval, a content aware approach is implemented that improves the quality of the estimation.

After estimating the compression metrics for all compressors, estimates of the compression metrics for the whole file are determined as previously described.

Embodiments of the invention include probabilistic models for estimating the compression metrics of multiple compression algorithms (compressors) from the metrics collected from the execution of a single reference compression algorithm. The compression metrics of multiple compressors are estimated by running a single compressor on small chunks or a small chunk extracted from a file.

Embodiments of the invention, in addition to exploiting data patterns found in files, also exploit relationships between compressors.

FIGS. 6A and FIG. 8A describe a dataset and training data. With this training data, probabilistic models were built. FIG. 13A illustrates distributions 1302 for the audio training data. More specifically, the distributions 1302 are distributions of chunk compression ratios by chunk size, for each compressor relative to the reference compressor. FIG. 13A illustrates distributions for chunk sizes include 5%, 25%, 50%, 75%, and 100%. FIG. 13B illustrates distributions 1304 for image data for similar chunk sizes. The distributions 1304 are distributions of chunk compressions by chunk size, for each compressor for image files.

Embodiments of the invention, by way of example only, model the distributions illustrated in FIGS. 13A and 13B. Embodiments of the invention thus build a model to learn, from a training set of files, the relationships between performance metrics of a set of compressors and a reference compressor. The model is used to infer estimations of those metrics for a given chunk size on a test set of files. These estimates, from the chunks, are then used in another model to infer estimations of compression metrics for complete files.

An experimental validation of the inference was performed using 500 files of each type, from the same datasets, as test files. These test files were not used to train the probabilistic models. In a practical application, a single new file would be chunked into a pre-determined size (e.g., 5%) and the compression metrics of each compressor would be estimated based on the learned distributions from the training data. For validation purposes, this process is performed for each of these files using multiple chunk sizes. Each chunk is compressed with the reference compressor. In addition, each chunk and each full test file are compressed with all compressors to obtain the actual compression ratio of the file. This allows errors in estimations to be measured.

FIG. 13C illustrates a comparison of the quality of the model of model inference between the probabilistic model and a linear mode. In this example, the ground truth was the actual compression ratio obtained by running each compressor on all chunks of all test files. The mean squared error (MSE) was measured and its standard deviation, between estimation and ground truth for a larger set of image and audio compressors. The overall MSE across all compressors for the probabilistic model for image files was approximately 0.04 and about 0.06 for the linear model. For audio files, the MSE for the probabilistic model was 0.0052 and 0.0054 for the audio files.

The probabilistic model has a small favorable difference. On a compressor by compressor basis, the probabilistic model was up to 4.5 times better than the linear compressor for images and up to 2 times better for audio files. The probabilistic model (blue) versus the linear model (orange) for image and audio files is illustrated in FIG. 13C.

FIG. 13D illustrates differences between the corrected ratio and the true ratio for various chunk sizes. With the estimations for each compressor generated from the compression metrics of the reference compressor, the inference to estimate the compression ratios on the full test files from the estimations obtained from the file chunks is performed. Some results for the test set—for chunks of 5%, 45% and 90%—are shown in FIG. 13D, comparing, for each chunk (x-axis), the obtained corrected ratio to the true ratio (y-axis). As illustrated in the graphs 1308, for larger chunks (e.g. 90% chunks, bottom), the estimated ratio is, expectedly, much closer to the true compression ratio. For smaller chunks (e.g., 5% chunks, top) the corrected ratios may differ from the true ratio.

In FIG. 13D, the mean squared errors between chunk ratios (corrected chunk ratio, in orange; original chunk ratio, in blue) and the true compression ratios. The mean squared error obtained with embodiments of the invention is smaller than that obtained with the compression chunks without correction. In addition, the effectiveness of applying the correction factors should be particularly noticeable on smaller chunks. Indeed, as the figure shows, the positive effects of the models (the reduction in the mean squared error) are noticeable across all chunk sizes. Thus, embodiments of the invention effectively predict or estimate the compression ratio on the full file from the compression of a small chunk using only the reference compressor.

FIG. 13E illustrates the effect of correction on the estimated ratios. In other words, the correction factor improved the estimated compression metrics, particularly for smaller chunk sizes.

As illustrated in FIG. 9D, embodiments of the invention can generate rankings based on the estimated compression metrics. FIG. 13F illustrates histograms 1312 that include the scores of the estimated rankings when the estimated compression metrics are based on a single reference compressor. The histograms 1312 illustrate that embodiments of the invention achieve a ranking identical to the true ranking in a majority of files. For the image files, the rankings are practically identical to the true rankings.

Thus, embodiments of the invention make it possible to select the best compressor for a file from the execution of a single reference compressor on a relatively small chunk of the file. Further embodiments of the invention allow speed gains and improvements that are proportional to the number of compressors to choose from.

Embodiments of the invention, such as the examples disclosed herein, may be beneficial in a variety of respects. For example, and as will be apparent from the present disclosure, one or more embodiments of the invention may provide one or more advantageous and unexpected effects, in any combination, some examples of which are set forth below. It should be noted that such effects are neither intended, nor should be construed, to limit the scope of the claimed invention in any way. It should further be noted that nothing herein should be construed as constituting an essential or indispensable element of any invention or embodiment. Rather, various aspects of the disclosed embodiments may be combined in a variety of ways so as to define yet further embodiments. Such further embodiments are considered as being within the scope of this disclosure. As well, none of the embodiments embraced within the scope of this disclosure should be construed as resolving, or being limited to the resolution of, any particular problem(s). Nor should any such embodiments be construed to implement, or be limited to implementation of, any particular technical effect(s) or solution(s). Finally, it is not required that any embodiment implement any of the advantageous and unexpected effects disclosed herein.

The following is a discussion of aspects of example operating environments for various embodiments of the invention. This discussion is not intended to limit the scope of the invention, or the applicability of the embodiments, in any way.

At least some embodiments of the invention provide for the implementation of the disclosed functionality in existing backup platforms, examples of which include the Dell-EMC NetWorker and Avamar platforms and associated backup software, and storage environments such as the Dell-EMC DataDomain storage environment. In general however, the scope of the invention is not limited to any particular data backup platform or data storage environment.

Devices in the operating environment may take the form of software, physical machines, or VMs, containers, or any combination of these, though no particular device implementation or configuration is required for any embodiment. Similarly, data protection system components such as databases, storage servers, storage volumes (LUNs), storage disks, replication services, backup servers, restore servers, backup clients, and restore clients, for example, may likewise take the form of software, physical machines or virtual machines (VM), though no particular component implementation is required for any embodiment. Where VMs are employed, a hypervisor or other virtual machine monitor (VMM) may be employed to create and control the VMs. The term VM embraces, but is not limited to, any virtualization, emulation, or other representation, of one or more computing system elements, such as computing system hardware. A VM may be based on one or more computer architectures, and provides the functionality of a physical computer. A VM implementation may comprise, or at least involve the use of, hardware and/or software. An image of a VM may take the form of a .VMX file and one or more .VMDK files (VM hard disks) for example.

As used herein, the term ‘data’ is intended to be broad in scope. Thus, that term embraces, by way of example and not limitation, data segments such as may be produced by data stream segmentation processes, data chunks, data blocks, atomic data, emails, objects of any type, files of any type including media files, word processing files, spreadsheet files, and database files, as well as contacts, directories, sub-directories, volumes, and any group of one or more of the foregoing. File types are also examples of data.

Example embodiments of the invention are applicable to any system capable of storing and handling various types of objects, in analog, digital, or other form. Although terms such as document, file, segment, block, or object may be used by way of example, the principles of the disclosure are not limited to any particular form of representing and storing data or other information. Rather, such principles are equally applicable to any object capable of representing information.

As used herein, the term ‘backup’ is intended to be broad in scope. As such, example backups in connection with which embodiments of the invention may be employed include, but are not limited to, full backups, partial backups, clones, snapshots, and incremental or differential backups.

It is noted with respect to the example method of Figure(s) XX that any of the disclosed processes, operations, methods, and/or any portion of any of these, may be performed in response to, as a result of, and/or, based upon, the performance of any preceding process(es), methods, and/or, operations. Correspondingly, performance of one or more processes, for example, may be a predicate or trigger to subsequent performance of one or more additional processes, operations, and/or methods. Thus, for example, the various processes that may make up a method may be linked together or otherwise associated with each other by way of relations such as the examples just noted.

Following are some further example embodiments of the invention. These are presented only by way of example and are not intended to limit the scope of the invention in any way.

Embodiment 1. A method, comprising: receiving a file at a compression engine configured to select an optimal compressor from a set of compressors to compress the file, extracting a chunk from the file, compressing the chunk with a reference compressor included in the set of compressors, determining compression metrics for the reference compressor, determining compression metrics each of the compressors in the set of compressors based on the compression metrics of the reference compressor, and selecting the optimal compressor based on the determined compression metrics of the compressors in the set of compressors.

Embodiment 2. The method of embodiment 1, further comprising: determining a correction factor for each of the compressors in the set of compressors, determining estimated file metrics for each of the compressors based on the compression metrics and the correction factors, and selecting the optimal compressor from the valid compressors based on the file metrics.

Embodiment 3. The method of embodiment 1 and/or 2, further comprising generating training data from a set of training files, the training data including a joint distributions of chunk compression ratios per chunk size, for each of the compressors relative to the reference compressor.

Embodiment 4. The method of embodiment 1, 2, and/or 3, further comprising locating the compression metrics onto the joint distribution.

Embodiment 5. The method of embodiment 1, 2, 3, and/or 4, further comprising locating a neighborhood around the compression metrics for the chunk.

Embodiment 6. The method of embodiment 1, 2, 3, 4, and/or 5, further comprising computing an expected value of the correction factor within the neighborhood.

Embodiment 7. The method of embodiment 1, 2, 3, 4, 5, and/or 6, further comprising applying the correction factor to the compression metrics to determine the estimated file metrics.

Embodiment 8. The method of embodiment 1, 2, 3, 4, 5, 6, and/or 7, wherein selecting the optimal compressor includes selecting the optimal compressor based on the estimated file metrics, a service level agreement, and/or an application.

Embodiment 9. The method of embodiment 1, 2, 3, 4, 5, 6, 7, and/or 8, further comprising determining a type of the file and extracting the chunk with a corresponding module for the type of the file.

Embodiment 10. The method of embodiment 1, 2, 3, 4, 5, 6, 7, 8, and/or 9, wherein the chunk complies with a format of the file.

Embodiment 11. The method of embodiment 1, 2, 3, 4, 5, 6, 7, 8, 9, and/or 10, further comprising determining the compression metrics using a model, wherein the model is linear or probabilistic.

Embodiment 12. A method for performing any of the operations, methods, or processes, or any portion of any of these, or any combination thereof disclosed herein including combinations of embodiments 1-11.

Embodiment 13. A non-transitory storage medium having stored therein instructions that are executable by one or more hardware processors to perform operations comprising the operations of any one or more of embodiments 1 through 12.

The embodiments disclosed herein may include the use of a special purpose or general-purpose computer including various computer hardware or software modules, as discussed in greater detail below. A computer may include a processor and computer storage media carrying instructions that, when executed by the processor and/or caused to be executed by the processor, perform any one or more of the methods disclosed herein, or any part(s) of any method disclosed.

As indicated above, embodiments within the scope of the present invention also include computer storage media, which are physical media for carrying or having computer-executable instructions or data structures stored thereon. Such computer storage media may be any available physical media that may be accessed by a general purpose or special purpose computer.

By way of example, and not limitation, such computer storage media may comprise hardware storage such as solid state disk/device (SSD), RAM, ROM, EEPROM, CD-ROM, flash memory, phase-change memory (“PCM”), or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other hardware storage devices which may be used to store program code in the form of computer-executable instructions or data structures, which may be accessed and executed by a general-purpose or special-purpose computer system to implement the disclosed functionality of the invention. Combinations of the above should also be included within the scope of computer storage media. Such media are also examples of non-transitory storage media, and non-transitory storage media also embraces cloud-based storage systems and structures, although the scope of the invention is not limited to these examples of non-transitory storage media.

Computer-executable instructions comprise, for example, instructions and data which, when executed, cause a general purpose computer, special purpose computer, or special purpose processing device to perform a certain function or group of functions. As such, some embodiments of the invention may be downloadable to one or more systems or devices, for example, from a website, mesh topology, or other source. As well, the scope of the invention embraces any hardware system or device that comprises an instance of an application that comprises the disclosed executable instructions.

Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts disclosed herein are disclosed as example forms of implementing the claims.

As used herein, the term ‘module’ or ‘component’ may refer to software objects or routines that execute on the computing system. The different components, modules, engines, and services described herein may be implemented as objects or processes that execute on the computing system, for example, as separate threads. While the system and methods described herein may be implemented in software, implementations in hardware or a combination of software and hardware are also possible and contemplated. In the present disclosure, a ‘computing entity’ may be any computing system as previously defined herein, or any module or combination of modules running on a computing system.

In at least some instances, a hardware processor is provided that is operable to carry out executable instructions for performing a method or process, such as the methods and processes disclosed herein. The hardware processor may or may not comprise an element of other hardware, such as the computing devices and systems disclosed herein.

In terms of computing environments, embodiments of the invention may be performed in client-server environments, whether network or local environments, or in any other suitable environment. Suitable operating environments for at least some embodiments of the invention include cloud computing environments where one or more of a client, server, or other machine may reside and operate in a cloud environment.

Any one or more of the entities disclosed, or implied, by the Figures or elsewhere herein, may take the form of, or include, or be implemented on, or hosted by, a physical computing device. As well, where any of the aforementioned elements comprise or consist of a virtual machine (VM), that VM may constitute a virtualization of any combination of the physical components disclosed herein.

In one example, a physical computing device includes a memory which may include one, some, or all, of random access memory (RAM), non-volatile memory (NVM) such as NVRAM for example, read-only memory (ROM), and persistent memory, one or more hardware processors, non-transitory storage media, UI device, and data storage. One or more of the memory components of the physical computing device may take the form of solid-state device (SSD) storage. As well, one or more applications may be provided that comprise instructions executable by one or more hardware processors to perform any of the operations, or portions thereof, disclosed herein.

Such executable instructions may take various forms including, for example, instructions executable to perform any method or portion thereof disclosed herein, and/or executable by/at any of a storage site, whether on-premises at an enterprise, or a cloud computing site, client, datacenter, data protection site including a cloud storage site, or backup server, to perform any of the functions disclosed herein. As well, such instructions may be executable to perform any of the other operations and methods, and any portions thereof, disclosed herein.

The present invention may be embodied in other specific forms without departing from its spirit or essential characteristics. The described embodiments are to be considered in all respects only as illustrative and not restrictive. The scope of the invention is, therefore, indicated by the appended claims rather than by the foregoing description. All changes which come within the meaning and range of equivalency of the claims are to be embraced within their scope. 

What is claimed is:
 1. A method, comprising: receiving a file at a compression engine configured to select an optimal compressor from a set of compressors to compress the file; extracting a chunk from the file; compressing the chunk with a reference compressor included in the set of compressors; determining compression metrics for the reference compressor; determining compression metrics each of the compressors in the set of compressors based on the compression metrics of the reference compressor; determining a correction factor for each of the compressors in the set of compressors; determining estimated file metrics for each of the compressors based on the compression metrics and the correction factors; and selecting the optimal compressor for compressing the file based on the estimated file metrics.
 2. The method of claim 1, further comprising determining the compression metrics using a model, wherein the model is linear or probabilistic.
 3. The method of claim 1, further comprising generating training data from a set of training files, the training data including a joint distributions of chunk compression ratios per chunk size, for each of the compressors relative to the reference compressor.
 4. The method of claim 3, further comprising locating the compression metrics onto the joint distribution.
 5. The method of claim 4, further comprising locating a neighborhood around the compression metrics for the chunk.
 6. The method of claim 5, further comprising computing an expected value of the correction factor within the neighborhood.
 7. The method of claim 6, further comprising applying the correction factor to the compression metrics to determine the estimated file metrics.
 8. The method of claim 1, wherein selecting the optimal compressor includes selecting the optimal compressor based on the estimated file metrics, a service level agreement, and/or an application.
 9. The method of claim 1, further comprising determining a type of the file and extracting the chunk with a corresponding module for the type of the file.
 10. The method of claim 1, wherein the chunk complies with a format of the file.
 11. A non-transitory storage medium having stored therein instructions that are executable by one or more hardware processors to perform operations comprising: receiving a file at a compression engine configured to select an optimal compressor from a set of compressors to compress the file; extracting a chunk from the file; compressing the chunk with a reference compressor included in the set of compressors; determining compression metrics for the reference compressor; determining compression metrics each of the compressors in the set of compressors based on the compression metrics of the reference compressor; determining a correction factor for each of the compressors in the set of compressors; determining estimated file metrics for each of the compressors based on the compression metrics and the correction factors; and selecting the optimal compressor for compressing the file based on the estimated file metrics.
 12. The non-transitory storage medium of claim 11, further comprising determining the compression metrics using a model, wherein the model is linear or probabilistic.
 13. The non-transitory storage medium of claim 11, further comprising generating training data from a set of training files, the training data including a joint distributions of chunk compression ratios per chunk size, for each of the compressors relative to the reference compressor.
 14. The non-transitory storage medium of claim 13, further comprising locating the compression metrics onto the joint distribution.
 15. The non-transitory storage medium of claim 14, further comprising locating a neighborhood around the compression metrics for the chunk.
 16. The non-transitory storage medium of claim 15, further comprising computing an expected value of the correction factor within the neighborhood.
 17. The non-transitory storage medium of claim 16, further comprising applying the correction factor to the compression metrics to determine the estimated file metrics.
 18. The non-transitory storage medium of claim 11, wherein selecting the optimal compressor includes selecting the optimal compressor based on the estimated file metrics, a service level agreement, and/or an application.
 19. The non-transitory storage medium of claim 11, further comprising determining a type of the file and extracting the chunk with a corresponding module for the type of the file.
 20. The non-transitory storage medium of claim 11, wherein the chunk complies with a format of the file. 